import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: 'id',
    align:"center",
    dataIndex: 'createTime',
    resizable:true
  },
  {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime',
    resizable:true
  },
  {
    title: '工厂',
    align: "center",
    sorter: true,
    dataIndex: 'factoryId_dictText',
    resizable:true
  },
  {
    title: '包材',
    align: "center",
    sorter: true,
    dataIndex: 'name',
    resizable:true
  },
  {
    title: '图片',
    align:"center",
    dataIndex: 'img',
    customRender:render.renderImage,
    resizable:true
  },
  {
    title: '总库存',
    align:"center",
    dataIndex: 'totalStock',
    sorter: true,
    resizable:true
  },
  {
    title: '占用库存',
    align:"center",
    dataIndex: 'lockStock',
    sorter: true,
    resizable:true
  },
  {
    title: '可用库存',
    align:"center",
    dataIndex: 'stock',
    sorter: true,
    resizable:true
  },
  {
    title: '日均消耗',
    align:"center",
    dataIndex: 'averageUsage',
    sorter: true,
    resizable:true
  },
  {
    title: '预计可用天数',
    align:"center",
    dataIndex: 'availableDays',
    sorter: true,
    resizable:true
  },
  {
    title: '单位',
    align: "center",
    sorter: true,
    dataIndex: 'unit',
    resizable:true
  },
];

// 高级查询数据
export const superQuerySchema = {
  factoryId: {title: '工厂',order: 0,view: 'sel_search', type: 'string',dictCode: 'p_factory_manage,name,code',},
  // packagingId: {title: '包材',order: 1,view: 'sel_search', type: 'string',dictTable: "p_packaging", dictCode: 'id', dictText: 'name',},
  stock: {title: '库存',order: 2,view: 'number', type: 'number',},
};
